<?php
	

	class xl_quan_huyen extends database
	{
		/*khánh*/
		function danhSachQuanHuyenTheoTinhThanh($id)
		{
			$this->setQuerry('select * from quanhuyen where MaTinhThanh = '.$id);
			$result = $this->loadAllRow();
			return $result;
		}
		/*end*/
		function danhSachQuanHuyen()
		{
			$this->setQuerry('select * from quanhuyen');
			$result = $this->loadAllRow();
			return $result;
		}
		function themQuanHuyen($tenquanhuyen,$matinhthanh)
		{
			$this->setQuerry("insert into quanhuyen values(N'$tenquanhuyen','$matinhthanh')");
			$result=$this->querry();
			return $result;
		}
		function capNhatTinhThanh($maquanhuyen,$tenquanhuyen,$matinhthanh)
		{
			$this->setQuerry("update quanhuyen set TenQuanHuyen='$tenquanhuyen', MaTinhThanh=$matinhthanh where 		MaQuanHuyen=$maquanhuyen");
			$result=$this->querry();
			return $result;
		}
		function xoaTinhThanh($maquanhuyen)
		{
			$this->setQuerry("delete from quanhuyen where MaQuanHuyen=$maquanhuyen");
			$result=$this->querry();
			return $result;
		}
	}
?>